﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;
[SugarTable(DbTableName.QyAdminDept)]
public class UserDept : ICategoryEntity
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Name { get; set; }
    public int Type { get; set; }
    public int OrderNum { get; set; }
    public string ContentCateRole { get; set; }
    public string DocCatRole { get; set; }
    public DateTime GreatTime { get; set; }
    public string Remark { get; set; }

}

public class EditUserDept
{
    public int Id { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "上级部门")]
    public int Pid { get; set; }
    [Required(ErrorMessage = "请输入{0}")]
    [Display(Name = "部门名称")]
    public string Name { get; set; }
    [Display(Name = "部门排序")]
    [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
    public int OrderNum { get; set; }
    public int Type { get; set; } 
    public DateTime GreatTime { get; set; }
    public string Remark { get; set; }
}


public class ViewUserDept
{
    public int Id { get; set; }
    public int Pid { get; set; }
    public string Name { get; set; }
    public int OrderNum { get; set; }
    public DateTime GreatTime { get; set; }
    public string Remark { get; set; }
    public int Depth { get; set; }
    public string Spread { get; set; }
    public int ChildrenCount { get; set; }
    public bool HaveChild { get; set; }
    public bool Open { get; set; }
    public List<ViewUserDept> Children { set; get; } = new();
    public string Title { set; get; }
}

public class ContentCatRole
{
    public int Id { get; set; }
    [Display(Name = "网站栏目权限")]
    public string ContentCateRole { get; set; }
    public string Name { get; set; }
}

public class DocCatRoles
{
    public int Id { get; set; }
    [Display(Name = "网站栏目权限")]
    public string DocCatRole { get; set; }
    public string Name { get; set; }
}